package com.zy.kotlinmvplib.base

import android.content.Context
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentPagerAdapter


class CommonViewPagerAdapter(fm: FragmentManager, val context: Context, val fragmentList: List<Fragment>, val titles: Array<String>) : FragmentPagerAdapter(fm) {

    override fun getItem(p0: Int): Fragment  = fragmentList.get(p0)

    override fun getCount(): Int = fragmentList.size

    override fun getPageTitle(position: Int): CharSequence? {
        return titles.get(position)
    }
}